home *** CD-ROM | disk | FTP | other *** search
- /* template.c */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-
- #include "al.h"
-
- /*****/
- void EveryChar(c)
- int c;
- /*****/
- {
- /* Print each character received. */
- printf("%c", c);
- }
-
- /*****/
- void main(argc, argv)
- /*****/
- int argc;
- char *argv[];
- {
- int com;
- int err, add_info;
-
- argc = argc; /* for compiler. */
- argv = argv; /* for compiler. */
-
- /* Initial AutoLibrary. */
- AvidInitAutoLibrary(AVID, &add_info, "_B'3'");
-
- /* Open the communcation port. */
- com = AvidOpenPort(AVID, "com1", &add_info, ".b'9600' .1 .8 .n +S -H");
-
- /* Display AutoLibrary version. */
- AvidVersion(AVID, &add_info, "");
-
-
- /* Ready for automation. */
-
- /* Do Hello World example as described in the Getting Started section
- of the reference manual. */
- AvidRegisterSend(AVID, com, "Hello World", &add_info, "");
- AvidRegisterWait(AVID, com, 1, "Hello Back", &add_info, "");
- if ((AvidSendSearch(AVID, com, (long)20, (long)120, &add_info, "")) == 1)
- printf("Found Hello Back.\n");
- else
- printf("Timeout occurred.\n");
-
- /* Finished so close the com port. */
- AvidClosePort(AVID, com, &add_info, "");
-
- /* Exit from AutoLibrary. */
- AvidExitAutoLibrary(AVID, &add_info, "");
- }